********************************************************************
*Run using StataNow/MP 19.5
*Import csv file: HAO_June_2025.csv
********************************************************************
**Create "Figure 1: Average Number of Access Obstruction Reports Per Country-Year Observation (Arms Support versus No Arms Support from OECD-DAC)"
********************************************************************

*Calculate how many country-year observations entailed a government receiving arms support from OECD-DAC member states (to confirm that n=107).

count if support_dummy == 1

*Calculate how many country-year observations entailed a government NOT receiving arms support from OECD-DAC member states (to confirm that n=79).

count if support_dummy == 0

*Produce bar graph

label define support_lbl 0 "No OECD-DAC Arms Support (n=79)" 1 "OECD-DAC Arms Support (n=107)"
label values support_dummy support_lbl
graph bar obstruction_reports, over(support_dummy, sort(1)) bar(1, color(black)) ytitle("Average Number of Access Obstruction Reports") 

********************************************************************
**Create "Table 2: Humanitarian Access Obstruction—Ordinary Least Squares Regression Analysis"
********************************************************************

*Standardize predictors

egen zsupport = std(support)
egen zmedia = std(media)
egen zfunding = std(funding)
egen zdeaths = std(deaths)
egen zreports = std(reports)
egen zgdp = std(gdp)
egen zgni = std(gni)

*Run regression - Model 1

regress obstruction_reports zsupport zreports, cluster(country)
estimates store model1

*Run regression - Model 2

regress obstruction_reports zsupport zreports zmedia zfunding zdeaths icc rtrc, cluster(country)
estimates store model2

*Run regression - Model 3

regress obstruction_reports zsupport zreports zmedia zfunding zdeaths icc rtrc zgdp, cluster(country)
estimates store model3

*Run regression - Model 4

regress obstruction_reports zsupport zreports zmedia zfunding zdeaths icc rtrc zgni, cluster(country)
estimates store model4

*Produce regression table
 
label variable zsupport "SUPPORT"
label variable zreports "REPORTS"
label variable zmedia "MEDIA"
label variable zfunding "FUNDING"
label variable zdeaths "DEATHS"
label variable icc "ICC"
label variable rtrc "RTRC"
label variable zgdp "GDP"
label variable zgni "GNI"
esttab model1 model2 model3 model4 using "table2.rtf", mtitles("Model 1" "Model 2" "Model 3" "Model 4") keep(zsupport zreports zmedia zfunding zdeaths icc rtrc zgdp zgni) label se star(* 0.05 ** 0.01 *** .001) stats(r2 N N_clust) note("Robust standard errors in parentheses.")
